package com.example.testproject.adapter

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.example.testproject.R
import com.example.testproject.bean.MqttBean

/**
 *
 * @ClassName: MqttAdapter
 * @Author: android 超级兵
 * @CreateDate: 11/23/21$ 10:27 AM$
 * TODO
 */
class MqttAdapter(data:List<MqttBean>) :
    BaseMultiItemQuickAdapter<MqttBean, BaseViewHolder>(data) {
    companion object {
        const val LEFT_SERVICE = 0
        const val RIGHT_USER = 1
    }

    init {
        addItemType(LEFT_SERVICE, R.layout.mqtt_left_service)
        addItemType(RIGHT_USER, R.layout.mqtt_right_user)
    }

    override fun convert(helper: BaseViewHolder, item: MqttBean) {
        helper.setText(R.id.mqttTv, "${item.content}")
    }
}